package coml.jiyun.hp.wanandroid.presenter;

import coml.jiyun.hp.wanandroid.base.BasePresenter;
import coml.jiyun.hp.wanandroid.bean.BannerBean;
import coml.jiyun.hp.wanandroid.bean.HomeBean;
import coml.jiyun.hp.wanandroid.model.HomeModel;
import coml.jiyun.hp.wanandroid.net.ResultCallBack;
import coml.jiyun.hp.wanandroid.view.HomeView;

public class HomePresenter extends BasePresenter<HomeView> {

    private HomeModel homeModel;

    @Override
    protected void initModel() {
        homeModel = new HomeModel();
        addModel(homeModel);
    }
    public void getHome(){
        homeModel.getHome(new ResultCallBack<HomeBean>() {
            @Override
            public void onSuccess(HomeBean homeBean) {
                mView.getHome(homeBean);
            }

            @Override
            public void onFail(String msg) {

            }
        });
    }

    public void getBanner(){
        homeModel.getBanner(new ResultCallBack<BannerBean>() {
            @Override
            public void onSuccess(BannerBean bannerBean) {
                mView.getBanner(bannerBean);
            }

            @Override
            public void onFail(String msg) {

            }
        });
    }

}
